/*
 * Copyright (c) 2013 WDCY Information Technology Co. Ltd
 * www.wdcy.cc
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * WDCY Information Technology Co. Ltd ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement you
 * entered into with WDCY Information Technology Co. Ltd.
 */
package com.andaily.zhishifenzi.service.impl;

import com.andaily.zhishifenzi.domain.commons.GeckoFile;
import com.andaily.zhishifenzi.domain.dto.file.CKEditorFileDto;
import com.andaily.zhishifenzi.service.FileService;
import org.springframework.stereotype.Service;

/**
 * @author Shengzhao Li
 */
@Service("fileService")
public class FileServiceImpl implements FileService {

    @Override
    public String uploadCKEditorFile(CKEditorFileDto fileDto) {
        final GeckoFile geckoFile = fileDto.toFile();
        geckoFile.saveOrUpdate();
        return geckoFile.guid();
    }
}